﻿<Window x:Class="Nox.Amuse.View.CommandHistoryWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Command History"
        Height="500"
        Width="600"
        WindowStartupLocation="CenterOwner"
        WindowStyle="ToolWindow"
        ShowInTaskbar="False"
        ResizeMode="CanResizeWithGrip"
        Icon="/Amuse;component/Images/ComHistory256.png">
    <Grid Margin="11">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ListBox ItemsSource="{Binding CommandHistoryItems}"
                 x:Name="historyList"
                 SelectedItem="{Binding SelectedHistoryItem}"
                 SelectedIndex="{Binding SelectedHistoryIndex, Mode=OneWay}"
                 ItemTemplate="{StaticResource CommandHistoryItemDataTemplate}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 ScrollViewer.VerticalScrollBarVisibility="Visible"
                 Margin="0,0,0,7">
            <ListBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Command="{Binding RecallCommand}"
                              Header="_Recall Selected Command"
                              TextBlock.FontWeight="Bold" />
                    <MenuItem Command="{Binding SendCommand}"
                              Header="_Send Selected Command" />
                    <Separator />
                    <MenuItem Command="{Binding ClearCommand}"
                              Header="_Empty Command History" />
                </ContextMenu>
            </ListBox.ContextMenu>
        </ListBox>
        <StackPanel Orientation="Horizontal"
                    Grid.Row="1"
                    HorizontalAlignment="Right">
            <Button Content="_Recall"
                    Margin="0,0,7,0"
                    Command="{Binding RecallCommand}" />
            <Button Content="_Send"
                    Command="{Binding SendCommand}" />
        </StackPanel>
    </Grid>
</Window>
